package com.jk.bgrotation.controller;

import com.jk.bgrotation.entity.SlideShowEntity;
import com.jk.bgrotation.service.UserServcie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("lgf")
public class TestController {
    @Autowired
    private UserServcie userServcie;

    //查询正常的图
    @RequestMapping("getList")
    public Object getList (){
        return userServcie.getList();
    }

    //回收站  查询不正常的图
    @RequestMapping("getList2")
    public Object getList2 (){
        return userServcie.getList2();
    }

    //回收站的恢复按钮 id为 slideshowId
    @RequestMapping("upstatus")
    public void upstatus(@RequestBody Integer slideshowId){
        userServcie.upstatus(slideshowId);
    }

    //新增 正常且下架的图
    @PostMapping("addShow")
    public Object addShow(@RequestBody SlideShowEntity show){
        return userServcie.addShow(show);
    }
    //轮播图 操作 逻辑删除
    @RequestMapping("upShowStatus")
    public void upShowStatus(@RequestBody Integer slideshowId){
        userServcie.upShowStatus(slideshowId);
    }

    //上架图片
    @RequestMapping("grounding")
    public void grounding(@RequestBody Integer slideshowId){
        userServcie.grounding(slideshowId);
    }

    //下架图片
    @RequestMapping("undercarriage")
    public void undercarriage(@RequestBody Integer slideshowId){
        userServcie.undercarriage(slideshowId);
    }

    //事件
    @RequestMapping("on")
    public Object on (@RequestBody Integer commodityId){
        return userServcie.on(commodityId);
    }






}
